package Work4;

import java.sql.SQLOutput;

public class CalculatorDemo {
    public static void main(String[] args) {
            useCalculator(new Calculator() {
                @Override
                public int calc(int a, int b) {
                    return  a+b;
                }
            });
        useCalculator(( a , b)->
             a+b
        );
    }
    public static  void useCalculator(Calculator c){
      int result = c.calc(3,4);
        System.out.println(result);
    }
}


interface Calculator{
    int calc(int a ,int b);
}
